// miniprogram/pages/result/result.js
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    var result = wx.getStorageSync('result');
    this.setData({
      result: result
    })
    console.log(this.data)


      var zkz = wx.getStorageSync('zkz');
      var name = wx.getStorageSync('name');
      var daima = wx.getStorageSync('daima');
      var leixing = wx.getStorageSync('leixing');

        wx.request({ //发送请求
          url: "https://zg99.offcn.com/index/chaxun/getlist/?actid=35388&callback=?",
          data: {
            name: name,
            zkz: zkz,
            leixing: leixing,
            daima: daima,
            limits: '100'   
          }, //接收参数
          success(res) { //返回
            var jsonStr = res.data;
            jsonStr = jsonStr.replace("(", "");
            jsonStr = jsonStr.replace(")", "");
            if (typeof jsonStr != 'object') {
              jsonStr = jsonStr.replace(/\ufeff/g, ""); //字符串转化JSON对象
              var theJson = JSON.parse(jsonStr);
            };
            // console.log(theJson)
            if (theJson.status == '2') {
              console.log('暂无数据！')
            } else {
              that.setData({
                theList: theJson.lists
              })
            }
            // console.log(that.data.theList)
          }
        })
    
  
  },
  retrun: function (e) {
    var that = this;
    wx.setStorageSync('mscx', e.currentTarget.dataset.res);
    wx.navigateTo({
      url: '../mscx/mscx',
    })
  },
  
  
  ceping: function (e) {
    var that = this;
    wx.setStorageSync('mscx', e.currentTarget.dataset.res);
    wx.navigateTo({
      url: '../../hz/yvy/yvy',
    })
  },
  





  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})